package com.biz.primus.ms.oms.api;

import com.biz.primus.model.oms.vo.UserOrderOperationRequest;
import com.biz.primus.model.oms.vo.returns.UserFillReturnExpressInfoRequestVo;
import com.biz.primus.model.oms.vo.returns.UserOperateReturnRequestVo;
import com.biz.primus.ms.base.api.BaseApiController;
import com.biz.primus.ms.oms.service.core.OrderStateService;
import com.biz.primus.ms.oms.service.returns.OrderReturnStateService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yanweijin
 * @date 2017/11/24
 */
@RestController
@RequestMapping("soa/omsUserApi")
public class OmsUserApiController extends BaseApiController {


	@Autowired
	private OrderStateService orderStateService;

	@Autowired
	private OrderReturnStateService returnStateService;

	@PostMapping("cancelOrder")
	@ApiOperation("用户取消订单")
	public void cancelOrder(@RequestBody UserOrderOperationRequest req){
		orderStateService.cancelOrder(req);
	}

	@PostMapping("cancelReturns")
	@ApiOperation("用户取消退货单")
	public void cancelReturns(@RequestBody UserOperateReturnRequestVo req){
		returnStateService.cancelReturns(req);
	}

	@PostMapping("confirmReceive")
	@ApiOperation("用户签收订单")
	public void confirmReceive(@RequestBody UserOrderOperationRequest req){
//		orderStateService.finishOrder();
	}


	@PostMapping("fillReturnExpressInfo")
	@ApiOperation("用户取消退货单")
	public void fillReturnExpressInfo(@RequestBody UserFillReturnExpressInfoRequestVo req){
		returnStateService.fillReturnExpressInfo(req);
	}
}
